package com.zky.group.grouporder.feign;

import com.zky.common.entity.SeckillGoodsEntity;
import com.zky.common.entity.SeckillOrderEntity;
import com.zky.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("seckill-kill")
@RequestMapping("/kill/seckillgoods")
public interface SeckillGoodsFeignService {


    /**
     * 信息
     */
    @RequestMapping("/info/{seckillId}")
//    @RequiresPermissions("kill:seckillgoods:info")
    public R info(@PathVariable("seckillId") Long seckillId);

    /**
     * 保存
     */
    @RequestMapping("/save")
//    @RequiresPermissions("kill:seckillgoods:save")
    public R save(@RequestBody SeckillGoodsEntity seckillGoods);

    /**
     * 修改
     */
    @RequestMapping("/update")
//    @RequiresPermissions("kill:seckillgoods:update")
    public int update(@RequestBody SeckillGoodsEntity seckillGoods);

    /**
     * 删除
     */
    @RequestMapping("/delete")
//    @RequiresPermissions("kill:seckillgoods:delete")
    public R delete(@RequestBody Long[] seckillIds);

    /**
     * 秒杀查
     * @param id
     * @return
     */
    @RequestMapping("/infoOrder/{id}")
//    @RequiresPermissions("kill:seckillorder:info")
    public R infoOrder(@PathVariable("id") Long id);

    /**
     * 秒杀订单保存
     */
    @RequestMapping("/saveOrder")
//    @RequiresPermissions("kill:seckillorder:save")
    public R saveOrder(@RequestBody SeckillOrderEntity seckillOrder);


}
